package Services

import(
	"github.com/gin-gonic/gin"
	"net/http"
	"gin/Common"
)

// 宏观数据
func DisplayMarketNew(c *gin.Context) {
	date := c.Query("date")
	start_date,end_date := Common.TimelineFutureDate(date, 3)
	sql := Common.TimelineOrderSql(Common.Timeline_market, Common.Order_inc)
	result,data := Common.GetTimelineData(sql, start_date, end_date)
	if (!result) {
		c.JSON(http.StatusOK, gin.H{
	        "result": -1,
	        "msg":    "query fail",
	        "data": "{}",
	    })
		return
	}

	c.JSON(http.StatusOK, gin.H{
        "result": 0,
        "msg":    "success",
        "data": data,
    })
}

